
# //编译目标
use_path_as_tar(${CMAKE_CURRENT_SOURCE_DIR} TAR)
clear_var(SRCS)
aux_source_directory(. SRCS)
add_library(${TAR} ${SRCS})

# //文件夹名称
# SimpleFactory
# FactoryMethod
# Singleton
# Strategy
# Decorator
# Proxy
# TemplateMethod
# Builder
# Observer
# AbstractFactory
# State

# //子目录
add_subdirectory(SimpleFactory)
add_subdirectory(FactoryMethod)
add_subdirectory(Singleton)
add_subdirectory(Strategy)
add_subdirectory(Decorator)
add_subdirectory(Proxy)
add_subdirectory(TemplateMethod)
add_subdirectory(Builder)
add_subdirectory(Observer)
add_subdirectory(AbstractFactory)
add_subdirectory(State)
add_subdirectory(Adapter)
add_subdirectory(Memento)
add_subdirectory(Composite)
add_subdirectory(Iterator)
add_subdirectory(Bridge)
add_subdirectory(Command)
add_subdirectory(ResponsibilityChain)
add_subdirectory(Mediator)
add_subdirectory(Flyweight)
add_subdirectory(Interpreter)

# //子目录依赖库
target_link_libraries(${TAR} ${TAR}_SimpleFactory)
target_link_libraries(${TAR} ${TAR}_FactoryMethod)
target_link_libraries(${TAR} ${TAR}_Singleton)
target_link_libraries(${TAR} ${TAR}_Strategy)
target_link_libraries(${TAR} ${TAR}_Decorator)
target_link_libraries(${TAR} ${TAR}_Proxy)
target_link_libraries(${TAR} ${TAR}_TemplateMethod)
target_link_libraries(${TAR} ${TAR}_Builder)
target_link_libraries(${TAR} ${TAR}_Observer)
target_link_libraries(${TAR} ${TAR}_AbstractFactory)
target_link_libraries(${TAR} ${TAR}_State)
target_link_libraries(${TAR} ${TAR}_Adapter)
target_link_libraries(${TAR} ${TAR}_Memento)
target_link_libraries(${TAR} ${TAR}_Composite)
target_link_libraries(${TAR} ${TAR}_Iterator)
target_link_libraries(${TAR} ${TAR}_Bridge)
target_link_libraries(${TAR} ${TAR}_Command)
target_link_libraries(${TAR} ${TAR}_ResponsibilityChain)
target_link_libraries(${TAR} ${TAR}_Mediator)
target_link_libraries(${TAR} ${TAR}_Flyweight)
target_link_libraries(${TAR} ${TAR}_Interpreter)

